document.oncontextmenu=function () {
    event.returnValue = false
}
document.oncopy=function () {
    event.returnValue = false
}
document.onkeydown=function () {
    if (window.event && window.event.keyCode==123){
        event.returnValue = false
    }
}
function verify_webdriver(){
    var webr = navigator.webdriver;
    elements = document.getElementById('content');
    if (webr){
        elements.innerHTML = "请不要使用自动化测试工具访问网页";
    }else{
        elements.innerHTML = "\
        <p>4月6日，在2019英雄联盟职业联赛春季赛季后赛第二轮比赛中，RNG苦战5局，最终以2比3败给同在北京的JDG战队。至此，历届LPL（英雄联盟职业联赛）冠军在本赛季联赛中均被淘汰。</p>\
        <p>LPL历届冠军：</p>\
        <p>2013春季赛 OMG、2013夏季赛 PE</p>\
        <p>2014春季赛 EDG、2014夏季赛 EDG</p>\
        <p>2015春季赛 EDG、2015夏季赛 LGD</p>\
        <p>2016春季赛 RNG、2016夏季赛 EDG</p>\
        <p>2017春季赛 WE、2017夏季赛 EDG</p>\
        <p>2018春季赛 RNG、2018夏季赛 RNG</p>";
    }
}

function browsers(){
    var userAgent = navigator.userAgent;
    var platform = navigator.platform;
    var width = screen.width;
    var height = screen.height;
    var cookieEabled = navigator.cookieEnabled;
    var hardwareConcurrency = navigator.hardwareConcurrency;
    var dateZone = new Date().getTimezoneOffset();
    var length = navigator.plugins.length;
    var colordepth = window.screen.colorDepth;

    var xhr = new XMLHttpRequest();
    var url_ajax = 'http://localhost:5000/features/ajax';
    xhr.open('POST',url_ajax,true);
    var data = new FormData()
    data.append('userAgent',userAgent)
    data.append('platform',platform)
    data.append('width',width)
    data.append('height',height)
    data.append('cookieEabled',cookieEabled)
    data.append('hardwareConcurrency',hardwareConcurrency)
    data.append('dateZone',dateZone)
    data.append('length',length)
    data.append('colordepth',colordepth)
    xhr.send(data);
    xhr.onload  = function () {
        console.log(xhr.responseText)
        if (xhr.responseText == 'True'){
            document.getElementById('first').innerHTML = userAgent;
            document.getElementById('second').innerHTML = platform;
            document.getElementById('three').innerHTML = width;
            document.getElementById('four').innerHTML = height;
            document.getElementById('five').innerHTML = cookieEabled;
            document.getElementById('six').innerHTML = hardwareConcurrency;
            document.getElementById('seven').innerHTML = dateZone;
            document.getElementById('eight').innerHTML = length;
            document.getElementById('nine').innerHTML = colordepth;
        }
    };
}